Timezone API
This API allows users to set the timezone for the appliance and list available timezones.
Set the timezone for the appliance
This API allows users to set the timezone for the appliance.
POST api/v1/config/configure-timezone/
Request Format
Request Parameters
NAME | REQUIRED | DESCRIPTION | TYPE |
---|---|---|---|
timezone | Required | Timezone to set for the appliance. | application/json |
Request Examples
cURL
# Add --insecure before the URL if you are using a self-signed SSL certificate
curl -X 'POST' \
'http://api.example.com/api/v1/config/configure-timezone/' \
-H 'Authorization: <token-here>' \
--json '{"timezone": "Europe/Zagreb"}'
Python
import requests
# Change the values of the URL, headers, and data
url = "http://api.example.com/api/v1/config/configure-timezone/"
headers = {
"accept": "application/json",
"Content-Type": "application/json"
}
data = {
"timezone": "Europe/Zagreb"
}
# Add verify=False in the request if you are using a self-signed SSL certificate
response = requests.post(url, headers=headers, json=data, verify=False)
print(response.status_code)
print(response.text)
Response Format
The response does not return any data or response body.
List available timezones
This API allows users to list available timezones for the appliance.
GET api/v1/config/list-available-timezones/
Request example
cURL
curl 'http://api.example.com/api/v1/config/list-available-timezones/' \
-H 'Authorization: Token <token-here>'
Response Format
The response format returns a list of available timezones.
{
"timezones": [
"Africa/Abidjan",
"Africa/Accra",
"Africa/Addis_Ababa",
"Africa/Algiers",
"Africa/Asmara",
"Africa/Bamako",
"Africa/Bangui",
"Africa/Banjul",
"Africa/Bissau",
"Africa/Blantyre",
"Africa/Brazzaville",
"Africa/Bujumbura",
"Africa/Cairo",
"Africa/Casablanca",
"Africa/Ceuta",
"Pacific/Wallis",
"UTC"
]
}
Response Status Codes
CODE | DESCRIPTION |
---|---|
200 | OK |